#ifndef SHAPE_HPP
#define SHAPE_HPP
#include <iostream>
#include <cmath>

class Shape
{
public:
    Shape();
    ~Shape();
    virtual double area() = 0;
};

class Rectangle : public Shape
{
public:
    Rectangle(double w = 0, double h = 0);
    ~Rectangle();
    double area() override;
    friend std::istream &operator>>(std::istream &in, Rectangle &r);

protected:
    double width, height;
};
class Square : public Rectangle
{
public:
    Square(double l = 0);
    ~Square();
    friend std::istream &operator>>(std::istream &in, Square &s);
};
class Circle : public Shape
{
public:
    Circle(double r = 0);
    ~Circle();
    double area() override;
    friend std::istream &operator>>(std::istream &in, Circle &c);

private:
    double radius;
};
#endif